﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace weighing
{
    /// <summary>
    /// 磅单 和 打印配制
    /// </summary>
    public class BillPrintConfig
    {

        public static BillPrintConfig Default
        {
            get
            {
                return new BillPrintConfig
                {
                    LimitInPrintTimes = 1,
                    LimitOutPrintTimes = 1,
                    EnablePrintInBill= true,
                    EnablePrintOutBill = true,
                    AutoPrint = false,
                    Header = "BD",
                    NumberSort = 1,
                    ShowInDesc = true,
                    ShowOutDesc = true,
                    InDesc = "白联存根，红联财务，绿联随车，黄联运费，其它;",
                    OutDesc = "白联存根，红联财务，绿联随车，黄联运费，其它;",
                    InShowCalculate = false,
                    OutShowCalculate = false,
                    AutoOpenCarQueueWindow = false,
                    AutoOpenAutoPrintWindow = false,
                    AutoPrintInterval = 10,
                    AutoGeneretor = true,
                    NumberMode = BillNumberMode.ChartAndNumber,
                };
            }
        }

        /// <summary>
        /// 自动打开 排队窗口
        /// </summary>
        public bool AutoOpenCarQueueWindow { get; set; }

        /// <summary>
        /// 自动生成磅单编号，不可手动修改
        /// </summary>
        public bool AutoGeneretor { get; set; }

        /// <summary>
        /// 模式
        /// </summary>
        public BillNumberMode NumberMode { get; set; }
        /// <summary>
        /// 自动启动自动打单窗口
        /// </summary>
        public bool AutoOpenAutoPrintWindow { get; set; }

        /// <summary>
        /// 自动打单间隔 秒
        /// </summary>
        public int AutoPrintInterval { get; set; }

        /// <summary>
        /// 出库打印磅单
        /// </summary>
        public bool EnablePrintOutBill { get; set; }
        /// <summary>
        /// 出库打印磅单
        /// </summary>
        public bool EnablePrintInBill { get; set; }

        /// <summary>
        /// 限止出库磅单打印次数
        /// </summary>
        public int LimitOutPrintTimes { get; set; }

        ///<summary>
        /// 限止入库磅单打印次数
        /// </summary>
        public int LimitInPrintTimes { get; set; }


        /// <summary>
        /// 自动打印
        /// </summary>
        public bool AutoPrint { get; set; }

        /// <summary>
        /// 磅单的开头字字母
        /// </summary>
        public string Header { get; set; }

        /// <summary>
        /// 磅单排序 开始编号 
        /// </summary>
        public int NumberSort { get; set; }

        /// <summary>
        /// 是否显示 出库 磅单 颜色的说明
        /// </summary>
        public bool ShowOutDesc { get; set; }
        /// <summary>
        /// 是否显示 入库 磅单 颜色的说明
        /// </summary>
        public bool ShowInDesc { get; set; }
        /// <summary>
        /// 出库磅单 颜色的说明
        /// </summary>
        public string OutDesc { get; set; }
        /// <summary>
        /// 入库磅单 颜色的说明
        /// </summary>
        public string InDesc { get; set; }

        /// <summary>
        /// 是否显示入库 结算信息
        /// </summary>
        public Boolean InShowCalculate { get; set; }
        /// <summary>
        /// 是否显示 出库 结算信息
        /// </summary>
        public Boolean OutShowCalculate { get; set; }

        /// <summary>
        /// 磅单打印机
        /// </summary>
        public string WeighingBillPrinterName { get; set; } = "默认打印机";
        public string ExitSlipPrinterName { get; set; } = "默认打印机";

        /// <summary>
        /// 所有打印单据都使用默认打印机
        /// </summary>
        public bool AllUserDefaultPrinter { get; set; } = true;

        /// <summary>
        ///磅单旋转角度
        /// </summary>
        public int WeighinBillAngle { get; set; } = 0;

        public PrintTimeType PrintTimeType { get; set; } = PrintTimeType.PrintDateTime;

        public DefaultBillTitleType BillTitleType { get; set; } = DefaultBillTitleType.UseCompanyFullName;

        public string FiexTitle { get; set; } = "过磅单";

        #region 卸货单

        /// <summary>
        /// 卸货单
        /// </summary>
        public bool EnableUnloadBill { get; set; } =false;

        /// <summary>
        /// 自动打印卸货单
        /// </summary>
        public bool AutoPrintUnloadBill { get; set; }= false;

        /// <summary>
        ///打印卸货单旋转角度
        /// </summary>
        public int UnLoadBillAngle { get; set; } = 0;

        public string UnLoadBillPrinterName { get; set; } = "默认打印机";
        #endregion

        #region 装货单

        /// <summary>
        /// 装货单
        /// </summary>
        public bool EnableLoadBill { get; set; } = false;

        /// <summary>
        /// 自动打印装货单
        /// </summary>
        public bool AutoPrintLoadBill { get; set; }= false;

        /// <summary>
        ///打印装货单旋转角度
        /// </summary>
        public int LoadBillAngle { get; set; } = 0;

        public string LoadBillPrinterName { get; set; } = "默认打印机";
        #endregion

        #region 自定义EXCL 磅单文件

        /// <summary>
        /// 是否使用 EXCL 作为自定义榜单模板工具
        /// </summary>
        public bool IsUserExclCustomBill { get; set; } = false;

        /// <summary>
        /// 自定义 混合 磅单文件
        /// </summary>
        public string MixtureExclFile { get; set; } = "";

        /// <summary>
        /// 自定义采购 EXCL 磅单文件
        /// </summary>
        public string BuyExclFile { get; set; } = "";

        /// <summary>
        /// 自定义销往 EXCL 磅单文件
        /// </summary>
        public string SaleExclFile { get; set; } = "";

        /// <summary>
        /// 自定义内倒 EXCL 磅单文件
        /// </summary>
        public string SelfExclFile { get; set; } = "";

        /// <summary>
        /// 自定义外来 EXCL 磅单文件
        /// </summary>
        public string ForeginExclFile { get; set; } = "";
        #endregion
    }
}
